using System;
using System.Collections.Generic;
using SouthernLand.Common.DAL;

namespace SouthernLand.Common.BOL
{
    public class NewsLetter : BizObject
    {
        #region Public Properties

        public Int32 NewsLetterID { get; set; }

        public String UserID { get; set; }

        public DateTime AddedDate { get; set; }

        public String Title { get; set; }

        public String FirstName { get; set; }

        public String LastName { get; set; }

        public String Email { get; set; }

        public String Company { get; set; }

        #endregion

        #region public static Methods

        public static Boolean DeleteByEmail(String Email)
        {
            var db = new NewsLetterDAL();
            return db.DeleteByEmail(Email);
        }

        public static Boolean CheckEmail(String Email)
        {
            var db = new NewsLetterDAL();
            return db.CheckEmail(Email);
        }

        public static int Insert(NewsLetter obj)
        {
            var db = new NewsLetterDAL();
            return db.Insert(obj);
        }

        public static bool Update(NewsLetter obj)
        {
            var db = new NewsLetterDAL();
            return db.Update(obj);
        }

        public static bool Delete(Int32 NewsLetterID)
        {
            var db = new NewsLetterDAL();
            return db.Delete(NewsLetterID);
        }

        public static NewsLetter GetNewsLetterByID(Int32 NewsLetterID)
        {
            var db = new NewsLetterDAL();
            return db.GetNewsLetterByID(NewsLetterID);
        }

        //Get All NewsLetter
        public static List<NewsLetter> GetAllNewsLetter()
        {
            var db = new NewsLetterDAL();
            return db.GetAllNewsLetter(1, MAXROWS);
        }

        //Get All NewsLetter
        public static List<NewsLetter> GetAllNewsLetter(int PageIndex, int PageSize)
        {
            var db = new NewsLetterDAL();
            return db.GetAllNewsLetter(PageIndex, PageSize);
        }

        // Get Count All records of Table  NewsLetter
        public static int GetCountNewsLetter()
        {
            var db = new NewsLetterDAL();
            return db.GetCountNewsLetter();
        }

        #endregion
    }
}